<template>
  <section>
    <div class="top">
      <div class="list_item" slot="list" v-for="item,key in list">
        <ul>
          <li class="list_info">
            <span style="font-size: .3rem;font-weight: bold;">{{item.name}}</span>
            <span></span>
          </li>
          <li class="list_info_down">
            <img src="../../assets/sech/position.png" style="width: .3rem;height: .35rem;">
            <span
              style="margin-left: .2rem;text-align: left;line-height: .45rem;display: flex;align-items: center;width: 88%;">{{item.address}}</span>
          </li>
        </ul>
      </div>
      <div style="text-align: center;padding-top: 2rem;" v-if="showis">
        <img src="../../assets/sech/no_tip.png" style="width: 4rem">
        <div style="margin-top: .3rem;">
          <span style="color: #666;">暂无相关数据</span>
        </div>
      </div>
    </div>
  </section>
</template>

<script>
  export default {
    name: "logisticsAreaResult",
    data() {
      return {
        list: [],
        showis: false,
      }
    },
    created() {
      const that = this;
      let TO_OBJECT = JSON.parse(sessionStorage.getItem('TO_OBJECT'));
      this.$ajax.post(window.g.apiUrl+'/user/isLog.do')
        .then((response) => {
          if (response.data.code != 200) {
            this.$dialog.notify({
              mes: '登录失效，正在跳转至登录页面',
              timeout: 1500,
              callback: () => {
                that.$router.push('/login');
              }
            });
          }
        }).catch(() => {
      })

      TO_OBJECT.data.forEach((val, old) => {
        if (val.address == '') {
          val.address = '未公开'
        }
      })
      this.list = TO_OBJECT.data;
      if (this.list.length == 0) {
        this.showis = true;
      }

    }
  }
</script>

<style scoped>
  .list_item {
    width: 96%;
    margin-left: 2%;
    margin-bottom: .3rem;
    padding: .2rem;
    border-bottom: 1px solid #f2f2f2;
  }

  .list_info {
    display: flex;
    justify-content: space-between;
    height: .6rem;
    align-items: center;
  }

  .list_info_down {
    display: flex;
    align-items: flex-start;
    padding-top: .1rem;
  }

  .top {
    overflow-y: auto;
    position: fixed;
    top: 0px;
    bottom: 0px;
    height: auto;
    padding-top: .3rem;
    width: 100%;
  }
</style>
